<template>
	<view class="content">
		<self-navbar :backPath="backPath" :title='title'></self-navbar>
		<global-notify></global-notify>
		<view style="flex-grow: 1; padding: 0 10px;">
			<mp-html :content="html" :tag-style="tag_style" />
		</view>
	</view>
</template>
<script>
	import {
		toast,
		clearStorageSync,
		setStorageSync,
		getStorageSync,
		useRouter
	} from '@/utils/utils.js'
	export default {
		data() {
			return {
				backPath: '/pages/mine/about/index',
				pageType: '',
				html: '',
				title: '',
				tag_style: {
					p: 'line-height:45rpx; margin-top: 30rpx;',
					img: 'width:100%',
				}
			}
		},
		onLoad(op) {
			this.pageType = op.pageType
			this.getPage()
		},
		onShow() {},
		onReady() {},
		methods: {
			getPage() {
				const param = {
					pageType: this.pageType
				}
				this.$api.page(param).then(res => {
					if (res.success) {
						let result = (res.result || {}).data
						this.title = result.title
						uni.setNavigationBarTitle({
							title: result.title
						})
						this.html = result.detail
						//解析HTML用到了插件mp-html,更多文档见：https://jin-yufeng.gitee.io/mp-html/#/overview/quickstart
					} else {
						toast(res.message)
					}
				})
			},
		}
	}
</script>
<style lang="scss" scoped>
	.content {
		// padding: 20rpx;
		background: $uni-bg-color;
		display: flex;
		flex-direction: column;
	}
</style>